    // 载入页面
    $.get("http://193.112.55.79:9090/api/getcategorytitle",function(res){
        var html = template("cateTitleTPL",{arr:res.result});
        $('section').html(html);
    })
    // 点击事件
    $('section').on('click','dl',function(){
        var flag = $(this).attr("data-flag");
        $(this).attr("data-flag","1");
        // console.log(flag)
        var id = $(this).attr('data-id');
        var father = $(this).children("dd");
        var target = $(this).children("dd").children("div");
        $.get("http://193.112.55.79:9090/api/getcategory",{"titleid":id},function(res){
            var html = template("cateContentTPL",{arr:res.result});
                // console.log({arr:res.result});
               target.html(html);
               $('dl dd').css("display","none");
               if(flag==1){
                // console.log(123);
                father.css("display","none");
                $('dl').removeAttr('data-flag');
               }else{
                father.css("display","block");
               }
        })
    })